package jp.eisbahn.mgapi.api.people;

import java.util.Arrays;

import jp.eisbahn.mgapi.api.User;

import org.json.simple.JSONObject;

/**
 * The model class to have person information.
 * @author Yoichiro Tanaka
 */
public class Person extends User {

    /**
     * Initialize this instance.
     * @param original JSONObject to have the person information.
     */
    protected Person(final JSONObject original) {
        super(original);
    }

    /**
     * Retrieve e-mail addresses.
     * @return The e-mail address array of String.
     */
    public final String[] getEmails() {
        return getPropertyStringArray("emails");
    }

    /*
     * (non-Javadoc)
     * @see java.lang.Object#toString()
     */
    @Override
    public final String toString() {
        return "Person [getId()=" + getId() + ", getDisplayName()="
                + getDisplayName() + ", getProfileUrl()=" + getProfileUrl()
                + ", getThumbnailUrl()=" + getThumbnailUrl() + ", getEmails()="
                + Arrays.toString(getEmails()) + "]";
    }

}
